﻿using System;

namespace Mono.Cecil
{
	// Token: 0x02000012 RID: 18
	public struct MetadataToken : IEquatable<MetadataToken>
	{
		// Token: 0x17000011 RID: 17
		// (get) Token: 0x060000D2 RID: 210 RVA: 0x0000CB28 File Offset: 0x0000AD28
		public uint RID
		{
			get
			{
				return this.token & 16777215U;
			}
		}

		// Token: 0x17000012 RID: 18
		// (get) Token: 0x060000D3 RID: 211 RVA: 0x0000CB48 File Offset: 0x0000AD48
		public TokenType TokenType
		{
			get
			{
				return (TokenType)(this.token & 4278190080U);
			}
		}

		// Token: 0x060000D4 RID: 212 RVA: 0x00002B44 File Offset: 0x00000D44
		public MetadataToken(uint token)
		{
			this.token = token;
		}

		// Token: 0x060000D5 RID: 213 RVA: 0x00002B4E File Offset: 0x00000D4E
		public MetadataToken(TokenType type)
		{
			this = new MetadataToken(type, 0);
		}

		// Token: 0x060000D6 RID: 214 RVA: 0x00002B5A File Offset: 0x00000D5A
		public MetadataToken(TokenType type, uint rid)
		{
			this.token = (uint)(type | (TokenType)rid);
		}

		// Token: 0x060000D7 RID: 215 RVA: 0x00002B5A File Offset: 0x00000D5A
		public MetadataToken(TokenType type, int rid)
		{
			this.token = (uint)(type | (TokenType)rid);
		}

		// Token: 0x060000D8 RID: 216 RVA: 0x0000CB68 File Offset: 0x0000AD68
		public int ToInt32()
		{
			return (int)this.token;
		}

		// Token: 0x060000D9 RID: 217 RVA: 0x0000CB80 File Offset: 0x0000AD80
		public uint ToUInt32()
		{
			return this.token;
		}

		// Token: 0x060000DA RID: 218 RVA: 0x0000CB68 File Offset: 0x0000AD68
		public override int GetHashCode()
		{
			return (int)this.token;
		}

		// Token: 0x060000DB RID: 219 RVA: 0x0000CB98 File Offset: 0x0000AD98
		public bool Equals(MetadataToken other)
		{
			return other.token == this.token;
		}

		// Token: 0x060000DC RID: 220 RVA: 0x0000CBB8 File Offset: 0x0000ADB8
		public override bool Equals(object obj)
		{
			bool flag = obj is MetadataToken;
			bool result;
			if (flag)
			{
				MetadataToken metadataToken = (MetadataToken)obj;
				result = (metadataToken.token == this.token);
			}
			else
			{
				result = false;
			}
			return result;
		}

		// Token: 0x060000DD RID: 221 RVA: 0x0000CBF4 File Offset: 0x0000ADF4
		public static bool operator ==(MetadataToken one, MetadataToken other)
		{
			return one.token == other.token;
		}

		// Token: 0x060000DE RID: 222 RVA: 0x0000CC14 File Offset: 0x0000AE14
		public static bool operator !=(MetadataToken one, MetadataToken other)
		{
			return one.token != other.token;
		}

		// Token: 0x060000DF RID: 223 RVA: 0x0000CC38 File Offset: 0x0000AE38
		public override string ToString()
		{
			return string.Format("[{0}:0x{1}]", this.TokenType, this.RID.ToString("x4"));
		}

		// Token: 0x0400003B RID: 59
		private readonly uint token;

		// Token: 0x0400003C RID: 60
		public static readonly MetadataToken Zero = new MetadataToken(0U);
	}
}
